package chapter_02

import org.apache.spark.{SparkConf, SparkContext}


class chapter_s02 {
  val conf = new SparkConf().setMaster("local").setAppName("My App")
  val sc = new SparkContext(conf)
  sc.setLogLevel("WARN")

  def sparkFirst(): Unit = {
    val lines = sc.textFile("pom.xml")
    val pythonLines = lines.filter(line => line.contains("dependency"))
    pythonLines.foreach(println)

    val f = pythonLines.first()
    println("打印出第一行！")
    println(f)
  }
}


object chapter_s02 {

  def main(args: Array[String]): Unit = {
    val ob: chapter_s02 = new chapter_s02
    ob.sparkFirst()
  }
}
